<include file="header" />

<body>
<div class="wraper">
    <div class="load">
        <img class="load-bee" src="/assets/base/repair/images/load-bee.png"/>

    </div>
    <div class="top">
        <p>   	
        	代理商申请
        </p>
    </div>
    <div class="checkbox">
        <p class="checked" data-type="0"><span class="iconfont icon-xuanzedianjihou"></span> </p>
    </div>

    <p class="title">省份</p>
    <p class="form-box">
    	<select id="province" name="province" class="input">
    		<option value="0">请选择省份</option>
    	</select>
    </p>
    <p class="title">市</p>
    <p class="form-box">
    	<select id="city" name="city" class="input">
    		<option value="0">请选择城市</option>
    	</select>
    </p>
    <!-- <p class="title">县/区</p>
    <p class="form-box">
    	<select id="area" name="area" class="input">
    		
    	</select>
    </p> -->
     <p class="title">姓名</p>
     <p class="form-box">
         <input class="input" id="real_name" value="" placeholder="请填写姓名"/>
     </p>
     <p class="title">手机</p>
     <p class="form-box">
         <input class="input" id="mobile" value="" placeholder="请填写手机号"/>
     </p>
     
    <div class="marginb-50"></div>
    <div class="btn-box">
    <input class="input" type="hidden" id="openid" value="{BEESCRM:$openid}" placeholder="请填写姓名"/>
    <input class="input" type="hidden" id="accountId" value="{BEESCRM:$accountId}" placeholder="请填写姓名"/>
        <a href="#" class="btn big" id="addAddr">我要合作</a>
    </div>
</div>

<include file="commonJS" />
<script>

$(function(){
	AreaObj.areaChoose();
    $('#addAddr').on('click',function(){
    	var data={};
    	var verify_method = /1[3|4|5|7|8][0-9]{9}/;
    	data.mobile=$('#mobile').val();
    	data.real_name=$('#real_name').val();
    	data.province = $('#province').val();
    	data.city = $('#city').val();
    	data.area = $('#area').val();
        if(!data.province || data.province==0){
            $.alert('error','请选择省份');
            return false;
        }
        if(!data.city || data.city==0 ){
            $.alert('error','请选择城市');
            return false;
        }
    	if(!data.real_name){
    		$.alert('error','姓名不能为空');
        	return false;
    	}
    	if (!verify_method.test(data.mobile)) {
        	$.alert('error','请输入正确的手机号');
        	return false;
        }	

        
       /* if(!data.area){
        	$.alert('error','请选择区域');
        	return false;
        }*/
        data.openid = $('#openid').val();
        data.account_id = $('#accountId').val();
            var json=new Object();
            json.url="/index.php?g=nskj&m=nskj&a=shop";
            json.data=data;
            json.method='post';
			$.getAjax(json, true, reload, '');
        
    });
    function reload(){
    	setTimeout("location.href ='{BEESCRM::U('charger/chargingproxAgent/index',array('accountId'=>$accountId))}'");
	}
})	
</script>
</body>
</html>